*===============================================================================
*
*					WORKER BELIEFS ABOUT OUTSIDE OPTIONS
*		(c)	Simon Jaeger, Christopher Roth, Nina Roussille, Benjamin Schoefer
*							  2023 December 5
*						   	   SOEP-IAB Data 
*
*===============================================================================


********************************************************************************
*								Figure II	 								   *
********************************************************************************

cap log close
log using ${log}/FigureII.log, replace 
	
use "$data/unionsample_finaldata.dta", clear		

cap noisily keep if feff_2010_2017!=. & salary!=. 
	
local xtitle "Belief About Wage Change if Moving to Outside Option"

su ln_own_change, d
	local mean: di %5.3f `r(mean)'
	local p50: di %5.3f `r(p50)'
	local N = r(N)
	
twoway (function y=`p50', range(0 0.5) lcolor(gs3) horizontal) (function y=`mean', range(0 0.5) lcolor(maroon) lpattern(dash) horizontal) (hist ln_own_change, frac bcolor(navy%60) fcolor(navy)), ///
legend(order(1 "Median:	`p50'" 2 "Mean:	`mean'") cols(1) ring(0) size(medsmall) position(11) region(lwidth(none)))	///
xtitle(`xtitle',  size(${fontsize})) ///
ytitle("Fraction", size(${fontsize})) ysc(r(0 `ymax')) ///
ylabel(#5,grid) xlabel(#10,grid)
graph export ${log}/FigureII.pdf, replace


log close 
clear